#!/bin/bash

rootpath=`pwd`
cd ./thirdpart

cd $rootpath/thirdpart/libmodbus
#libmodus
 ./autogen.sh 
./configure --enable-static 
make
cp src/.libs/libmodbus.a $rootpath/thirdpart/lib
#spdlog
cd  $rootpath/thirdpart/spdlog
if [ ! -d $rootpath/thirdpart/spdlog/build ];then
    mkdir build
fi
cd build
cmake ..
make
cp libspdlog.a $rootpath/thirdpart/lib

#sqlite3
cd  $rootpath/thirdpart/sqlite
./configure --enable-static --disable-shared --enable-threadsafe
make
cp .libs/libsqlite3.a $rootpath/thirdpart/lib

